package com.sui.bigdata.sml.model;

import com.feidee.fdcommon.configuration.CustomConfiguration;
import com.sui.bigdata.sml.model.util.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
 * @author songhaicheng
 * @date 2019/12/2 14:03
 * @description
 * @reviewer
 */
@Slf4j
@SpringBootApplication(scanBasePackages = "com.sui.bigdata.sml.model")
public class SmlModelApplication {

    public static void main(String[] args) {
        // 为了启动便利，不用 -D 传递模型参数到 System.property
        if (args.length == 0) {
            System.out.println("未在启动命令中发现模型启动信息！");
            System.exit(0);
        }
        CustomConfiguration.setString(Constants.ARG_BOOTSTRAP, args[0]);
        new SpringApplicationBuilder(SmlModelApplication.class).run();
        log.info("=========== 预测服务启动完成：{} -> {} ===========",
                CustomConfiguration.getString(Constants.SERVING_TOKEN),
                CustomConfiguration.getString(Constants.LOG_MODELS));
    }

}
